# -*- codeing = utf-8 -*-
# @Time : 2022/9/13 10:01
# @Author : 计科1814-16-徐澳
# @Software: PyCharm

'''
假设有9个球，分别是1~9的序号，把它们随机放到红黄蓝三个袋子中，请打印一次结果。tips:daizi=[ [ ],[ ],[ ] ]
'''
import random

bags=[[],[],[]]
balls=[1,2,3,4,5,6,7,8,9]
for ball in balls:
    index = random.randint(0,2)
    bags[index].append(ball)
i=1
for bag in bags:
    print("背包%d里的球的个数为:%d"%(i,len(bag)))
    i +=1
    for ball in bag :
        print("%d"%ball,end="\t")
    print()
    print("-"*30)
